#
#  M3G-Reader-Writer project file.
#


# project info
project (M3G_READER_WRITER)
cmake_minimum_required (VERSION 2.0)



# build type = Debug (defualt)
if (NOT CMAKE_BUILD_TYPE)
    message (STATUS "Build type is not specified, then")
    message (STATUS "  set CMAKE_BUILD_TYPE=Debug")
    set (CMAKE_BUILD_TYPE "Debug")
endif (NOT CMAKE_BUILD_TYPE)
message (STATUS "Configuring for ${CMAKE_BUILD_TYPE}...")

# for "Debug"
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    message (STATUS "  set CMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/bin")
    set (CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/bin)
endif (CMAKE_BUILD_TYPE STREQUAL "Debug")


# dependend libraries
find_package (ZLIB)

macro (config_project PROJNAME LIBNAME)
      message (STATUS "Config package \"${LIBNAME}\" ... ${${LIBNAME}_FOUND}")
      include_directories   (${${LIBNAME}_INCLUDE_DIR})
      target_link_libraries (${PROJNAME} ${${LIBNAME}_LIBRARIES})
endmacro ()



# project src
add_subdirectory (src)


